package com.abdd.hbxs_api.service.impl;

import com.abdd.hbxs_api.mapper.UserinfoMapper;
import com.abdd.hbxs_api.pojo.Userinfo;
import com.abdd.hbxs_api.service.UserinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserinfoServiceImpl  implements UserinfoService {

    @Autowired
    UserinfoMapper userinfoMapper;

    @Override
    public Userinfo findById(int userId) {
        Userinfo userinfo = userinfoMapper.findById(userId);
        return  userinfo;
    }

    @Override
    public Userinfo findByName(String userName){
        Userinfo userinfo = userinfoMapper.findByName(userName);
        return  userinfo;
    }

    @Override
    public int insert(Userinfo userinfo){
        userinfoMapper.insert(userinfo);
        return 1;
    }
}
